<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<META  http-equiv="Content-Type"  content="text/html;charset=UTF-8">
	<title><fmt:message key="account.list.title" /></title>
	<link rel="stylesheet"
		href="<c:url value="/css/blueprint/screen.css" />" type="text/css"
		media="screen, projection">
		<link rel="stylesheet"
			href="<c:url value="/css/blueprint/print.css" />" type="text/css"
			media="print">
			<!--[if lt IE 8]>
		<link rel="stylesheet" href="<c:url value="/css/blueprint/ie.css" />" type="text/css" media="screen, projection">
	<![endif]-->
</head>
<body>

<%   
Cookie cookies[]=request.getCookies();   
Cookie sCookie=null;   
String svalue="";   
for(int i=0;i<cookies.length;i++){   
   sCookie=cookies[i];   
   if(sCookie.getName().equals("mallCookie")){   
      svalue=sCookie.getValue();   
   }   
}  
request.setAttribute("mycookie" , svalue);  
%> 
	<div class="container">
		<h2>
			<fmt:message key="account.list.title" /> 
		</h2>
		${mycookie } <br />
		<a href="${ctx}/account/add">[新增]</a> &nbsp;
		<form action="/account/list" method="get">
			<table border="1" width="40%">
				<tr>
					<th>uid</th>
					<th>username</th>
					<th>password</th>
					<th>email</th>
					<th>usertype</th>
					<th>birthday</th>
					<th>address</th>
					<th>operation</th>
				</tr>
				<%-- 遍历 --%>
				<c:forEach items="${accountes}" var="account">
					<tr>
						<td>${account.uid }</td>
						<td>${account.username}</td>
						<td>${account.password}</td>
						<td>${account.email}</td>
						<td><c:if test="${account.usertype=='0'}">
					    普通
					</c:if> <c:if test="${account.usertype=='1'}">
					    VIP
					</c:if>
					</td>
					<td>
					  <fmt:formatDate value="${account.birthday}"
							pattern="yyyy年MM月dd日" />
					</td>
					<td>${account.address}</td>
					<td><a href="${ctx}/account/edit/${account.uid}">[修改]</a>
							&nbsp; <a href="${ctx}/account/delete/${account.uid}">[删除]</a>
							&nbsp;
					</td>
					</tr>					  
				</c:forEach>
			</table>
		</form>
	 
		<jsp:include page="/common/pager.jsp">
			<jsp:param name="url" value="${ctx}/account/list"/>
			<jsp:param name="params" value="username"/>
		</jsp:include>
</body>
</html>